import fetch from 'common/src/utils/fetch'
import baseUrl from './env'
// 评教管理
// 评教管理列表
function getStudentEvaPageList(data) {
    return fetch({
        url: `${baseUrl}/studentManagement/getPageList`,
        method: 'post',
        data
    })
}
// 评教管理列表导出
function exportStudentEvaList(data) {
    return fetch({
        url: `${baseUrl}/studentManagement/exportList`,
        method: 'post',
        data
    })
}
// 评教管理列表编辑
function updateStudentEva(data) {
    return fetch({
        url: `${baseUrl}/studentManagement/update`,
        method: 'post',
        data
    })
}
// 评教管理强制
function forceStudentEva(data) {
    return fetch({
        url: `${baseUrl}/studentManagement/force`,
        method: 'post',
        data
    })
}
// 评教管理列表新增
function addStudentEva(data) {
    return fetch({
        url: `${baseUrl}/studentManagement/add`,
        method: 'post',
        data
    })
}
// 评教管理列表删除
function deleteStudentEva(data) {
    return fetch({
        url: `${baseUrl}/studentManagement/delete`,
        method: 'post',
        data
    })
}
// 判断是否有人填写问卷
function judgeIfStudentEvaWrite(data) {
    return fetch({
        url: `${baseUrl}/studentManagement/delete/judge`,
        method: 'post',
        data
    })
}
// 发布
function releaseStudentEva(data) {
    return fetch({
        url: `${baseUrl}/studentManagement/release/ok`,
        method: 'post',
        data
    })
}
// 撤销
function withdrawStudentEva(data) {
    return fetch({
        url: `${baseUrl}/studentManagement/release/no`,
        method: 'post',
        data
    })
}
// 评教管理对象查询
function getStudentEvaObjectList(data) {
    return fetch({
        url: `${baseUrl}/studentManagement/object/getPageList`,
        method: 'post',
        data
    })
}
// 获取单条评教数据
function getStudentEvaDetail(data) {
    return fetch({
        url: `${baseUrl}/studentManagement/getOne`,
        method: 'post',
        data
    })
}
// 对象配置提交
function objectStudentEvaSetConfirm(data) {
    return fetch({
        url: `${baseUrl}/studentManagement/add/object`,
        method: 'post',
        data
    })
}
// 对象配置删除
function objectStudentEvaSetDelete(data) {
  return fetch({
      url: `${baseUrl}/studentManagement/delete/object`,
      method: 'post',
      data
  })
}
// 获取未评人数 /studentManagement/object/noFillSubject/getList
function getStuNotFillInList(data) {
    return fetch({
        url: `${baseUrl}/studentManagement/object/noFillSubject/getList`,
        method: 'post',
        data
    })
}
// 导出明细
function exportStuThemeDetailList(data) {
    return fetch({
        url: `${baseUrl}/studentManagement/object/detailed/exportList`,
        method: 'post',
        data
    })
}
// 导出问卷主题
function exportStuThemeList(data) {
    return fetch({
        url: `${baseUrl}/studentManagement/object/look/exportList`,
        method: 'post',
        data
    })
}

// 评学管理
// 评学管理列表
function getTeacherEvaPageList(data) {
    return fetch({
        url: `${baseUrl}/teacherManagement/getPageList`,
        method: 'post',
        data
    })
}
// 评学管理列表导出
function exportTeacherEvaList(data) {
    return fetch({
        url: `${baseUrl}/teacherManagement/exportList`,
        method: 'post',
        data
    })
}
// 导出第二个接口
function exportStatus(key) {
    return fetch({
        url: `${baseUrl}/file/result/${key}`,
        method: 'get'
    })
}
// 评学管理列表编辑
function updateTeacherEva(data) {
    return fetch({
        url: `${baseUrl}/teacherManagement/update`,
        method: 'post',
        data
    })
}
// 评学管理强制
function forceTeacherEva(data) {
    return fetch({
        url: `${baseUrl}/teacherManagement/force`,
        method: 'post',
        data
    })
}
// 评学管理列表新增
function addTeacherEva(data) {
    return fetch({
        url: `${baseUrl}/teacherManagement/add`,
        method: 'post',
        data
    })
}
// 评学管理列表删除
function deleteTeacherEva(data) {
    return fetch({
        url: `${baseUrl}/teacherManagement/delete`,
        method: 'post',
        data
    })
}
// 评学管理列表删除
function judgeIfTeacherEvaWrite(data) {
    return fetch({
        url: `${baseUrl}/teacherManagement/delete/judge`,
        method: 'post',
        data
    })
}
// 发布
function releaseTeacherEva(data) {
    return fetch({
        url: `${baseUrl}/teacherManagement/release/ok`,
        method: 'post',
        data
    })
}
// 撤销
function withdrawTeacherEva(data) {
    return fetch({
        url: `${baseUrl}/teacherManagement/release/no`,
        method: 'post',
        data
    })
}
// 评学管理对象查询
function getTeacherEvaObjectList(data) {
    return fetch({
        url: `${baseUrl}/teacherManagement/object/getPageList`,
        method: 'post',
        data
    })
}
// 获取单条评教数据
function getTeacherEvaDetail(data) {
    return fetch({
        url: `${baseUrl}/teacherManagement/getOne`,
        method: 'post',
        data
    })
}
// 对象配置提交
function objectTeacherEvaSetConfirm(data) {
    return fetch({
        url: `${baseUrl}/teacherManagement/add/object`,
        method: 'post',
        data
    })
}
// 对象配置删除
function objectTeacherEvaSetDelete(data) {
  return fetch({
      url: `${baseUrl}/teacherManagement/delete/object`,
      method: 'post',
      data
  })
}
// 导出明细
function exportTeacherThemeDetailList(data) {
    return fetch({
        url: `${baseUrl}/teacherManagement/object/detailed/exportList`,
        method: 'post',
        data
    })
}
// 导出问卷主题
function exportTeacherThemeList(data) {
    return fetch({
        url: `${baseUrl}/teacherManagement/object/look/exportList`,
        method: 'post',
        data
    })
}
// 计算分数--评学
function teacherCalculate(data) {
    return fetch({
        url: `${baseUrl}/teacherManagement/object/calculation`,
        method: 'post',
        data
    })
}
// 判断当前登录教学评价的角色是'学校管理员'or'学院教务员'or'学院老师'  true为管理员，false为教务员
function judgeLoginRole(data) {
    return fetch({
        url: `${baseUrl}/common/facultyCode`,
        method: 'post',
        data
    })
}
function judgeIfEvaAdmin(data) {
    return fetch({
        url: `${baseUrl}/common/roleType`,
        method: 'post',
        data
    })
}
const courseEvaluationApi = {
    getStudentEvaPageList,
    exportStudentEvaList,
    updateStudentEva,
    forceStudentEva,
    addStudentEva,
    deleteStudentEva,
    judgeIfStudentEvaWrite,
    releaseStudentEva,
    withdrawStudentEva,
    getStudentEvaObjectList,
    getStudentEvaDetail,
    objectStudentEvaSetConfirm,
    objectStudentEvaSetDelete,
    getStuNotFillInList,
    exportStuThemeDetailList,
    exportStuThemeList,

    getTeacherEvaPageList,
    exportTeacherEvaList,
    updateTeacherEva,
    forceTeacherEva,
    addTeacherEva,
    deleteTeacherEva,
    judgeIfTeacherEvaWrite,
    releaseTeacherEva,
    withdrawTeacherEva,
    getTeacherEvaObjectList,
    getTeacherEvaDetail,
    objectTeacherEvaSetConfirm,
    objectTeacherEvaSetDelete,
    exportStatus,
    exportTeacherThemeDetailList,
    exportTeacherThemeList,
    teacherCalculate,
    judgeLoginRole,
    judgeIfEvaAdmin
}
export default courseEvaluationApi
